using MicroMsg.Resource.@string;
using Microsoft.Phone.Controls;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class SnsLoadingCtrl : UserControl
	{
		public delegate void LoadingCtrlClick(object sender, object object_0);
		public static DependencyProperty modeTypeProperty = DependencyProperty.Register("modeType", typeof(LoadingState), typeof(SnsLoadingCtrl), new PropertyMetadata(LoadingState.LoadingMode, new PropertyChangedCallback(SnsLoadingCtrl.strTypePropertyChanged)));
		internal Button LayoutRoot;
		internal Canvas lineCanvas;
		internal TextBlock loadTxt;
		internal TextBlock ClickTxt;
		internal PerformanceProgressBar NetStatusProgressBar;
		private bool _contentLoaded;
		public event SnsLoadingCtrl.LoadingCtrlClick ItemClick;
		public LoadingState modeType
		{
			get
			{
				return (LoadingState)base.GetValue(SnsLoadingCtrl.modeTypeProperty);
			}
			set
			{
				base.SetValue(SnsLoadingCtrl.modeTypeProperty, value);
			}
		}
		public SnsLoadingCtrl()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.SnsLoadingCtrl_Loaded));
		}
		private void SnsLoadingCtrl_Loaded(object sender, RoutedEventArgs e)
		{
			base.SetValue(TiltEffect.IsTiltEnabledProperty, true);
		}
		private void LayoutRoot_Click(object sender, RoutedEventArgs e)
		{
			if (this.ItemClick != null && this.modeType == LoadingState.ClickToShowMoreMode)
			{
				this.ItemClick(sender, this.modeType);
			}
		}
		private static void strTypePropertyChanged(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (dependencyPropertyChangedEventArgs_0.get_Property() == SnsLoadingCtrl.modeTypeProperty)
			{
				SnsLoadingCtrl snsLoadingCtrl = dependencyObject_0 as SnsLoadingCtrl;
				if (snsLoadingCtrl.modeType == LoadingState.LoadingMode)
				{
					snsLoadingCtrl.NetStatusProgressBar.set_Visibility(0);
					snsLoadingCtrl.loadTxt.set_Visibility(1);
					snsLoadingCtrl.ClickTxt.set_Visibility(1);
					return;
				}
				snsLoadingCtrl.NetStatusProgressBar.set_Visibility(1);
				if (snsLoadingCtrl.modeType == LoadingState.ContactEndMode)
				{
					snsLoadingCtrl.loadTxt.set_Visibility(1);
					snsLoadingCtrl.ClickTxt.set_Visibility(1);
					snsLoadingCtrl.lineCanvas.set_Visibility(0);
					return;
				}
				if (snsLoadingCtrl.modeType == LoadingState.StrangerEndMode)
				{
					snsLoadingCtrl.loadTxt.set_Visibility(0);
					snsLoadingCtrl.ClickTxt.set_Visibility(1);
					snsLoadingCtrl.lineCanvas.set_Visibility(0);
					snsLoadingCtrl.loadTxt.set_Text(strings.Album_NoMoreTip);
					return;
				}
				if (snsLoadingCtrl.modeType == LoadingState.PullToShowMoreMode)
				{
					snsLoadingCtrl.loadTxt.set_Visibility(0);
					snsLoadingCtrl.ClickTxt.set_Visibility(1);
					snsLoadingCtrl.lineCanvas.set_Visibility(1);
					snsLoadingCtrl.loadTxt.set_Text(strings.Album_LoadMore);
					return;
				}
				if (snsLoadingCtrl.modeType == LoadingState.ClickToShowMoreMode)
				{
					snsLoadingCtrl.loadTxt.set_Visibility(1);
					snsLoadingCtrl.ClickTxt.set_Visibility(0);
					snsLoadingCtrl.lineCanvas.set_Visibility(1);
					snsLoadingCtrl.ClickTxt.set_Text(strings.WC_COMMENT_LIST_LOAD_MORE);
					return;
				}
				if (snsLoadingCtrl.modeType == LoadingState.ToTakePhotoTipMode)
				{
					snsLoadingCtrl.loadTxt.set_Visibility(0);
					snsLoadingCtrl.ClickTxt.set_Visibility(1);
					snsLoadingCtrl.lineCanvas.set_Visibility(1);
					snsLoadingCtrl.loadTxt.set_Text(strings.WC_MYALBUM_NO_CONTENT_TIPS);
				}
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/Sns/Common/UI/SnsMsg/SnsLoadingCtrl.xaml", 2));
			this.LayoutRoot = (Button)base.FindName("LayoutRoot");
			this.lineCanvas = (Canvas)base.FindName("lineCanvas");
			this.loadTxt = (TextBlock)base.FindName("loadTxt");
			this.ClickTxt = (TextBlock)base.FindName("ClickTxt");
			this.NetStatusProgressBar = (PerformanceProgressBar)base.FindName("NetStatusProgressBar");
		}
	}
}
